/-app
/-docs
/-docs/types
api.ts
/-files ...
FileTree.ts
FileTree2.ts
SyncStorageAccess.ts
/-imports
/-persistence
/-storage
/-typings
errors.js
functions.ts
index.html
try.js
x
      this.parent.remove(this);
 
182
    
183
      var appendLast = !nodeList.length || node.name > nodeList[nodeList.length - 1].name;
184
      if (appendLast) {
185
        nodeList.push(node);
186
        if (forceRerootingEvenIfOrdered)
187
          this.li.insertBefore(node.li, insertBeforeElement);
188
        return;
189
      }
190
​
191
      if (node.name < nodeList[0].name) {
192
        // goes at the head of the list
193
        nodeList.unshift(node);
194
        this.li.insertBefore(nodeList[0].li);
195
        return;
196
      }
197
      
198
      // binary search
199
      var loIndex = 1; // inclusive
200
      var hiIndex = nodeList.length - 2; // inclusive
201
      while (hiIndex - loIndex > 1) {
202
        var midIndex = loIndex + (((hiIndex - loIndex) / 2) | 0);
203
        var midNode = nodeList[midIndex];
204
        if (name > midNode.name) {
205
          loIndex = midIndex + 1; // inclusive
206
        }
207
        else {
208
          hiIndex = midIndex - 1; // inclusive
209
        }
210
      }
211
​
212
      this.li.insertBefore(node.li, nodeList[hiIndex].li);
213
      nodeList.splice(hiIndex, 0, node);
214
      
215
    }
216
    
217
  }
218
​
219
  export function normalizePath(path: string) : string {
220
    return path;
221
  }
222
  
223
}
220:3